package com.broadengate.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.broadengate.bean.RuleInfo;
import com.broadengate.bean.UserInfo;

public interface UserDao<T> extends BaseDao<T>
{
   public UserInfo login(UserInfo info);
   
   /**
    * 获取用户对应目录的所有子目录的权限
    * @param userId
    * @param pid
    * @return [参数说明]
    * 
    * @return List<RuleInfo> [返回类型说明]
    * @exception throws [违例类型] [违例说明]
    * @see [类、类#方法、类#成员]
    */
   public List<RuleInfo> getUserRuleList(@Param(value="userId") int userId,@Param(value="pid") String pid);
   
   public List<UserInfo> getUserList();
   
   /**
    * 查询用户对应目录权限
    * @param userId 用户ID
    * @param id 对应目录ID
    * @return [参数说明]
    * 
    * @return RuleInfo [返回类型说明]
    * @exception throws [违例类型] [违例说明]
    * @see [类、类#方法、类#成员]
    */
   public RuleInfo getUserRuleInfo(@Param(value="userId") int userId,@Param(value="id") String id);
   
   /**
    * 更改用户权限
    * @param info
    * @return [参数说明]
    * 
    * @return int [返回类型说明]
    * @exception throws [违例类型] [违例说明]
    * @see [类、类#方法、类#成员]
    */
   public int editUserRule(RuleInfo info)  throws SQLException;
   
   /**
    * 新增用户权限
    * @param info
    * @return
    * @throws SQLException [参数说明]
    * 
    * @return int [返回类型说明]
    * @exception throws [违例类型] [违例说明]
    * @see [类、类#方法、类#成员]
    */
   public int insertUserRule(RuleInfo info) throws SQLException;
   
   /**
    * 根据用户ID获取用户名称
    * @param employeeId
    * @return [参数说明]
    * 
    * @return String [返回类型说明]
    * @exception throws [违例类型] [违例说明]
    * @see [类、类#方法、类#成员]
    */
   public String getEmployeeNameById(@Param(value="employeeId")int employeeId);
}
